<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/7/21
 * Time: 14:31
 */
header("Content-Type: text/plain;charset=utf-8");
header("Access-Control-Allow-Origin:*");
header("Access-Control-Methods:POST,GET");

require_once('../../com/dao/suggDao.php');
require_once('../../com/dao/respDao.php');

$suggid = $_GET['suggid'];

//删除建言和回复
$suggDao = new SuggDao();
$respDao = new RespDao();

if( $suggDao->delete($suggid)&&$respDao->deleteBySugg($suggid)){
    $result = array('key'=>'success');
}else{
    $result = array('key'=>'error');
}

echo json_encode($result,JSON_UNESCAPED_UNICODE);